<!-- 执行记录 -->
<template>
  <div class="executionRecord">
    <el-timeline>
      <el-timeline-item color="#0bbd87" :hide-timestamp="true" v-for="i in data" :key="i">
        <div class='timestamp'>
          <div class="timestamp-name">
            {{i.clientNick}}
          </div>
          <div class="timestamp-time">
            {{parseTime(i.happenTime,'{y}-{m}-{d} {h}:{i}:{s}')}}
          </div>
        </div>
        <el-card>
          <div class="card-box">
            <div class="card-box-box">
              <!-- {{
                i.taskName + '|' + i.taskCode + '|' + i.processName + '|' + i.processCode + '|' + i.workstationName
              }} -->
              {{ i.taskName ? i.taskName : '暂无数据' }} &nbsp;&nbsp;|&nbsp;&nbsp;
              {{ i.taskCode ? i.taskCode : '暂无数据' }} &nbsp;&nbsp;|&nbsp;&nbsp;
              {{ i.processName ? i.processName : '暂无数据' }} &nbsp;&nbsp;|&nbsp;&nbsp;
              {{ i.processCode ? i.processCode : '暂无数据' }} &nbsp;&nbsp;|&nbsp;&nbsp;
              {{ i.workstationName ? i.workstationName : '暂无数据' }}
            </div>
            <div class="card-box-box">{{i.resumeType}}</div>
          </div>
          <div class="card-main">
            <div class="card-main-table" v-if="i.resumeType=='报工'">
              <div class="card-main-table-item">
                <div class="card-main-table-item-label">报工数量</div>
                <div class="card-main-table-item-value">{{i.feedback.quantityFeedback}}</div>
              </div>
              <div class="card-main-table-item">
                <div class="card-main-table-item-label">报工时间</div>
                <div class="card-main-table-item-value">{{i.feedback.feedbackTime}}</div>
              </div>
              <div class="card-main-table-item">
                <div class="card-main-table-item-label">检验日期</div>
                <div class="card-main-table-item-value">{{i.feedback.feedbackTime}}</div>
              </div>
              <div class="card-main-table-item">
                <div class="card-main-table-item-label">合格</div>
                <div class="card-main-table-item-value">{{i.feedback.quantityQualified}}</div>
              </div>
              <div class="card-main-table-item">
                <div class="card-main-table-item-label">不合格</div>
                <div class="card-main-table-item-value">{{i.feedback.quantityUnquanlified}}</div>
              </div>
              <div class="card-main-table-item">
                <div class="card-main-table-item-label">合格率</div>
                <div class="card-main-table-item-value">
                  {{
                    (i.feedback.quantityQualified/(i.feedback.quantityQualified+i.feedback.quantityUnquanlified)*100).toFixed(2) + '%'
                  }}
                </div>
              </div>
              <!-- <div class="card-main-table-item">
                <div class="card-main-table-item-label">检测结果</div>
                <div class="card-main-table-item-value">{{i.feedback.feedbackTime}}</div>
              </div> -->
            </div>
            <div class="card-main-table" v-if="i.resumeType=='领料'">
              <div class="card-main-table-item">
                <div class="card-main-table-item-label">领料单编号</div>
                <div class="card-main-table-item-value">{{i.wmItemConsumeSum.issueCode}}</div>
              </div>
              <div class="card-main-table-item">
                <div class="card-main-table-item-label">领料单名称</div>
                <div class="card-main-table-item-value">{{i.wmItemConsumeSum.issueName}}</div>
              </div>
              <div class="card-main-table-item">
                <div class="card-main-table-item-label">领料日期</div>
                <div class="card-main-table-item-value">{{parseTime(i.wmItemConsumeSum.consumeDate, '{y}-{m}-{d} {h}:{i}:{s}')}}</div>
              </div>
              <div class="card-main-table-item">
                <div class="card-main-table-item-label">领料种类</div>
                <div class="card-main-table-item-value">{{ i.wmItemConsumeSum.quantityConsumeTypeCount }}</div>
              </div>
              <div class="card-main-table-item">
                <div class="card-main-table-item-label">领料总数</div>
                <div class="card-main-table-item-value">{{ i.wmItemConsumeSum.quantityConsumeTotal }}</div>
              </div>
            </div>
          </div>
        </el-card>
      </el-timeline-item>
      
    </el-timeline>
  </div>
</template>

<script>
  export default {
    name: "executionRecord",
    props: {
      data: undefined
    },
    data() {
      return {

      }
    },
    created() {
      console.log('CNGD2025021100005',this.data);
    },
    methods: {

    }
  }
</script>

<style lang="scss" scoped>
.executionRecord{
  .timestamp {
    text-align: left;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    &-name{
      font-style: 14px;
      font-weight: 600;
      color: #000;
    }
    &-time{
      color: #999;
    }
  }
  .card-box{
    display: flex;
    align-items: center;
    margin-bottom: 0;
    padding: 0;
    &-box{
      font-size: 14px;
      margin-right: 100px;
      &:last-child{
        margin-right: 0;
      }
    }
  }
  .card-main{
    margin-top: 20px;
    &-table{
      display: flex;
      align-items: center;
      &-item{
        // margin-bottom: 8px;
        border: 1px solid #999;
        text-align: center;
        &-label{
          padding: 5px;
          font-size: 14px;
          color: #999;
          margin-right: 8px;
        }
        &-value{
          padding: 5px;
          font-size: 14px;
          color: #000;
          // border: 1px solid #999;
          border-top: 1px solid #999;
        }
      }
    }
  }

}
</style>